{include file="common:meta" /}
    <title>资讯列表 - 资讯管理 - TXCMS_V2</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
</head>
<body>
{include file="common:header" /}

{include file="common:menu" /}

<section class="Hui-article-box">
    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> <a href="{:url('index/index')}">首页</a>
        <span class="c-gray en">&gt;</span>
        资讯管理
        <span class="c-gray en">&gt;</span>
        资讯列表
        <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
    </nav>
    <div class="Hui-article">
        <article class="cl pd-20">
            <div class="cl pd-5 bg-1 bk-gray mt-20">
				<span class="l">
				<a class="btn btn-primary radius" data-title="添加资讯" _href="article-add.html" onclick="article_add('添加资讯','/admin.php/admin/article/add')" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 添加文章</a>
				</span>
            </div>

            <form class="form-inline" role="form" method="get" action="{:url('article/index')}">
                <div class="form-group">
                    <span style="color: red;">标题搜索:</span> <input style="width: 120px;" type="text" class="input-text" name="title" placeholder="请输入标题" value="{$title ? $title : '';}">
                    <span style="color: red;">分类搜索:</span> <input style="width: 120px;" type="text" class="input-text" name="cate" placeholder="请输入分类名" value="{$cate ? $cate : '';}">
                    <span style="color: #ff0000">根据状态搜索:</span><span class="select-box" style="width: 120px;">
                    <select name="status"  class="select">
                  <option value="" selected>请选择状态</option>
                  <option value="{$status ? $status : '1';}">隐藏</option>
                  <option value="{$status ? $status : '0';}">显示</option>
              </select>
        </span>
                    开始时间：<input type="text" class="input-text radius size-S" style="width: 100px" autocomplete="off" name="startTime" id="article1">-<input type="text" class="input-text radius size-S" style="width: 100px" name="endTime" id="article2" autocomplete="off">
                </div>
                <button type="submit" class="btn btn-default">用户查询</button>
            </form>

            <div class="mt-20">
                <div class="table-responsive">
                <table class="table table-border table-bordered table-bg table-hover table-sort">
                    <thead>
                    <tr class="text-c">
                        <th width="80">ID</th>
                        <th>标题</th>
                        <th>发布人</th>
                        <th>所属分类</th>
                        <th>小标题</th>
                        <th>图片</th>
                        <th width="150">发布时间</th>
                        <th width="100">文章状态</th>
                        <th width="120">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {volist name="ArticleList" id="vo"}
                    <tr class="text-c">
                        <td>{$vo.id}</td>
                        <td>{$vo.title}</td>
                        <td>{$vo.author}</td>
                        <td>{$vo.cate_name}</td>
                        <td>{$vo.s_title}</td>
                        <td><img style="width: 80px;" src="<?php echo $vo['img_url'];?>"></td>
                        <td>{$vo.create_time}</td>
                        <td class="td-status">
                            {if condition="$vo.status eq  0"}<span class="label label-success radius">显示</span>
                            {else /}<span class="label label-danger radius">隐藏</span>
                            {/if}

                        </td>
                        <td class="f-14 td-manage">
                            <a style="text-decoration:none" class="ml-5 btn btn-success-outline radius size-MINI" onClick="article_edit('资讯编辑','/admin.php/admin/article/edit?id={$vo.id}')" href="javascript:;" title="编辑">编辑</a>
                            <a style="text-decoration:none" class="ml-5 btn btn-warning-outline radius size-MINI" onClick="del({$vo.id})" href="javascript:;" title="删除">删除</a></td>
                    </tr>
                    {/volist}
                    </tbody>
                </table>
                    <span>{$quick ?? ''}</span>
                </div>
                <div style="float: right;">{$page}</div>
            </div>
        </article>
    </div>
</section>

{include file="common:footer" /}

<!--请在下方写此页面业务相关的脚本-->
{load href="__STATIC__/admin/lib/My97DatePicker/4.8/WdatePicker.js"}
{load href="__STATIC__/admin/lib/datatables/1.10.0/jquery.dataTables.min.js"}
{load href="__STATIC__/admin/lib/laypage/1.2/laypage.js"}
<script type="text/javascript">
    /*文章-编辑*/
    function article_edit(title,url,id,w,h){
       layer_show(title,url,id,w,h);
    }
    /*文章-删除*/
    function del(id)
    {
        $.get('/admin.php/admin/article/del','id='+id,function(res){
            if(res.code===1){
                layer.msg(res.msg,{icon:1});
                setTimeout(function () {
                    window.location.reload();
                },2000)
            }else{
                layer.msg(res.msg,{icon:2});
                setTimeout(function () {
                    window.location.reload();
                },2000)
            }
        })
    }
    /*时间选择*/
    laydate.render({
        elem: '#article1' //指定元素
        ,calendar: true
        ,theme: '#333'
        ,showBottom: true
    });
    laydate.render({
        elem: '#article2' //指定元素
        ,calendar: true
        ,theme: '#333'
        ,showBottom: true
    });
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>